<template>
  <div class="">
    <div class="tab_wrap">
      <div class="wrap_content">
        <ul>
          <li
            v-for="(item, i) in protit"
            :key="i"
            @click="gotoPage(i)"
            :class="{ current: mark == i }"
            class="pro-tit"
          >
            <span @click="show(i)"
              >{{ item }}
              <div></div>
            </span>
          </li>
        </ul>
      </div>
    </div>
    <div class="introduce" v-show="current == 0">
      <div class="basic_attribute">
        <div
          v-for="(item, index) in intro.top"
          :key="index"
          class="attribute_info"
        >
          <span class="a_name">{{ item.label }}</span>
          <span class="a_value" v-for="(child, i) in item" :key="i">{{
            child.label
          }}</span>
        </div>
      </div>
      <div class="basic_attribute">
        <div
          v-for="(item, index) in intro.bottom"
          :key="index"
          class="attribute_info"
        >
          <span class="a_name">{{ item.label }}</span>
          <span class="a_value" v-for="(child, i) in item" :key="i">{{
            child.label
          }}</span>
        </div>
      </div>
      <div v-for="(item, id) in data.items" :key="id" class="list-style">
        <div class="item-style">
          <div class="Exhibition">
            <div class="textwrap">
              <div class="textbox">
                <div>{{ item.textTit }}</div>
                <div>{{ item.preTit }}</div>
              </div>
            </div>
            <div class="picture" v-for="(child, i) in data.images" :key="i">
              <img :src="child" alt="" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="Parameter" v-show="current == 1">
      <div class="product_specification">
        <div v-for="(item, index) in images2" :key="index">
          <img :src="item" alt="" />
        </div>
        <div>
          <haier-detail-tr
            :label="item.label"
            :data="item.children"
            v-for="(item, index) in info"
            :key="index"
          ></haier-detail-tr>
        </div>
      </div>
    </div>
    <div class="Usercomment" v-show="current == 2">3</div>
    <div class="Service" v-show="current == 3">
      <div class="service-tabel">
        <el-table :data="tableData" stripe style="width: 100%">
          <el-table-column prop="filename" label="文件下载" width="420">
          </el-table-column>
          <el-table-column prop="filesize" label="文件大小" width="240">
          </el-table-column>
          <el-table-column
            prop="filetype"
            label="文件格式"
            width="180"
          ></el-table-column>
          <el-table-column
            prop="date"
            label="更新日期"
            width="180"
          ></el-table-column>
          <el-table-column label="下载地址" width="180">
            <template slot-scope="{ row }">
              <a :href="row.href">点击下载</a>
            </template>
          </el-table-column>
        </el-table>
        <div class="pro-manual">
          <div class="manual-tit"><h2>冰箱,冷柜</h2></div>
          <div v-for="(item, index) in manual" :key="index" class="manual-con">
            <h3>{{ item.title }}</h3>
            <p v-for="(child, i) in item.children" :key="i">
              {{ child.label }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import aftersale from "../assets/aftersale.json";
import prodata from "../assets/prodata.json";
import banner from "../assets/params.json";
import Params from "./params.vue";
export default {
  data() {
    return {
      protit: ["产品介绍", "规格参数", "用户口碑", "服务支持"],
      mark: 0,
      current: 0,
      intro: prodata,
      manual: aftersale,
      info: banner,
      tableData: [
        {
          filename: "BCD-610WDIEU1说明书",
          filesize: "21.64MB",
          filetype: "pdf",
          date: "2019-09-11",
          href: "点击下载",
        },
      ],
      data: {
        items: [
          {
            textTit: "ABT健康杀菌",
            preTit: "ABT杀菌技术,杀菌率超过99%,清除异味守护健康",
          },
          {
            textTit: "风冷无霜,新鲜不结霜",
            preTit:
              "先进全风冷技术，无需除霜；拥有多路精控风道系统，制冷快速均匀，不会破坏细胞结构，营养成分不流失。",
          },
        ],
        images1: [
          require("../../public/images/tag-2/t01.png"),
          // require("../../public/images/tag-2/t02.png"),
        ],
      },
      images2: [require("../../public/images/tag-2/p01.png")],
    };
  },
  methods: {
    gotoPage(i) {
      this.mark = i;
    },
    show(type) {
      this.current = type;
    },
  },
  components: {
    "haier-detail-tr": Params,
  },
};
</script>

<style scoped>
.tab_wrap {
  width: 100%;
  height: 80px;
  background: #fff;
  border-bottom: 0.5px solid gray;
}
.wrap_content {
  width: 800px;
  height: 80px;
  margin-left: 300px;
}
.wrap_content > ul {
  width: inherit;
  height: 100%;
}
.pro-tit {
  display: inline-block;
  width: 132px;
  height: 80px;
  text-align: center;
  line-height: 80px;
  font-size: 1.2rem;
}
.current > span > div {
  width: inherit;
  height: 5px;
  background: #0c5ca8;
}

.attribute_info {
  display: inline-block;
  margin-top: 55px;
  width: 300px;
  height: 154px;
  border-right: 0.5px solid gray;
}
.a_name {
  display: block;
  font-size: 1rem;
  color: #111;
  font-weight: 400;
  margin-top: 0.3rem;
  text-align: center;
  line-height: 50px;
}
.a_value {
  display: block;
  font-size: 1.8rem;
  color: #111;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 0.23rem;
  text-align: center;
}
.basic_attribute {
  width: 1300px;
  margin: 0 auto;
}

.list-style:nth-child(odd) > .item-style {
  width: 100%;
  height: 640px;
  background: #ffffff;
}

.list-style:nth-child(even) > .item-style {
  width: 100%;
  height: 640px;
  background: rgba(241, 237, 237, 0.473);
}
.list-style:nth-child(odd) > .item-style > .Exhibition {
  width: 65%;
  height: 100%;
  margin: 0 auto;
  position: relative;
}
.list-style:nth-child(odd) > .item-style > .Exhibition > .textwrap {
  width: 55%;
  height: 480px;
  background-color: #fafafa;
  box-shadow: 0 10px 12px 0 rgba(0, 0, 0, 0.1);
  z-index: 1;
  text-align: left;
  position: absolute;
  top: 80px;
}
.textbox {
  width: 70%;
  height: 156px;
  margin: 150px auto;
}
.textbox div:nth-child(1) {
  font-weight: 800;
  font-size: 3.5rem;
}
.textbox div:nth-child(2) {
  margin-top: 40px;
  font-size: 18px;
}
.picture > img {
  position: absolute;
  right: 0;
  top: 150px;
  width: 540px;
  height: 360px;
}
.list-style:nth-child(even) > .item-style > .Exhibition > .textwrap {
  text-align: right;
}
.product_specification {
  width: 70%;
  margin: 0 auto;
  text-align: center;
}
.service-tabel {
  width: 65%;
  margin: 0 auto;
}
.manual-tit {
  height: 48px;
  padding: 50px 17px 0 0;
  border-bottom: 0.5px solid rgb(189, 185, 185);
}
.manual-con > h3 {
  margin: 20px 0;
  height: 23px;
  border-bottom: 0.5px solid rgb(189, 185, 185);
}
.manual-con > p {
  margin: 20px 0;
}
</style>